// 此代码 需要指定编译到版本ES5或以上
// 运行   tsc  xxx.ts  -t  es5
class BookManager {
    password: string
    private _fullName:string = ''
    get fullName():string{
        console.log("get");
        
        return this._fullName
    }
    set fullName(name:string){
        console.log("set");
        
        if(this.password === '123'){
            this._fullName = name
            console.log("成功")
        }else{
            console.log("失败");
            
        }
    }
}

const mn = new BookManager()
// 没有设置密码
mn.fullName = '333'
console.log(mn.fullName)

// 设置密码
mn.password = "123"
mn.fullName = "333"
console.log(mn.fullName)